<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<script type="text/javascript">
	$(function() {
		$('#inputFormPwd input').tooltip();
		//表单验证
		$('#inputFormPwd').checkForm();
		$('#inputFormPwd').ajaxForm({
			url : _ctx + "/pub/sysmgr/usermgr/update_pwd.do",
			type : "post",
			dataType : "json",
			beforeSubmit: function(){
	        	var checkReturn = $('#inputForm').checkForm(null,false);
	        	if(checkReturn){
	        		$("#sbmBtn").attr("disabled","disabled");
	        	}
		       return checkReturn;
	        },
			clearForm : false,
			resetForm : false,
			success : function(resp) {
				if (resp.status == '1') {
					ui.msg(resp.msg, 1);
					location.reload();
				} else {
					alert(resp.msg);
					ui.msg(resp.msg, 0);
				}
			},
			error : function(resp) {
				ui.msg('请求发送失败', 0);
				$("#sbmBtn").removeClass("disabled").attr("disabled", null);
			}
		});
	});
</script>
<form class="form-horizontal"  id="inputFormPwd" action="${ctx}/pub/sysmgr/usermgr/update_pwd.do"  method="post" >
	<div class="form-group">
		<div class="col-sm-3 control-label no-padding-right"
			for="form-field-1">原始密码*</div>
		<div class="col-sm-9" style="padding-top: 7px;">
			<input type="password" class="col-xs-10 col-sm-5"
				name="oldPwd" id="oldPwd" datatype="require|ajax"
				msg="请输入原始密码!|原始密码错误！"
				url="${ctx}/pub/sysmgr/usermgr/check_pwd.do"
				 title="必填项,原始密码" placeholder="请输入原始密码" />
		</div>
	</div>
	<div class="form-group">
		<div class="col-sm-3 control-label no-padding-right"
			for="form-field-1">新密码 *</div>
		<div class="col-sm-9">
			<input type="password" class="col-xs-10 col-sm-5" name="newPwd"
				id="newPwd" datatype="require|limitB" msg="请输入密码！|密码长度6~30" min="6" max="30"
				oldValue="" title="必填项,密码" placeholder="请输入密码" />
		</div>
	</div>
	<div class="form-group">
		<div class="col-sm-3 control-label no-padding-right" 
			for="form-field-1">确认新密码 *</div>
		<div class="col-sm-9">
			<input type="password" class="col-xs-10 col-sm-5" 
				value=""  name="confirmPassword" id="confirmPassword" datatype="require|repeat|limitB" to="newPwd" placeholder="请再一次输入新密码"
				min="6" max="30" msg="请输入密码|两次输入的密码不匹配！|密码长度6~30" 
				title="请确认密码"/>
		</div>
	</div>
	<hr>
	<div class="clearfix form-group">
		<div class="col-md-offset-3 col-md-9">
			<button type="submit" class="btn btn-sm btn-info"
				id="sbmBtn">
				<i class="icon-ok bigger-110"></i>提交
			</button>
		</div>
	</div>
</form>
									